package com.dingding.transfer.stamper.service;

import com.alibaba.fastjson.JSONObject;
import com.dingding.transfer.stamper.constant.StamperEnum;
import com.dingding.transfer.stamper.dto.BaseResult;

/**
 * @author wangxiyuan
 * @description 印章回调策略
 * @createDate 2021/4/2 10:03
 **/
public interface CmdStrategy {
    default BaseResult parse(int cmd,String data){
        // 解析数据
        Object object = JSONObject.parseObject(data, StamperEnum.getType(cmd));
        // 针对不同数据处理逻辑不同
        return handle(object);
    }

    BaseResult handle(Object object);
}
